package cn.iocoder.yudao.module.crm.dal.mysql.billaccount;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crm.dal.dataobject.billaccount.BillAccountDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crm.controller.admin.billaccount.vo.*;

/**
 * 收款账号管理 Mapper
 *
 * @author nail.zhang
 */
@Mapper
public interface BillAccountMapper extends BaseMapperX<BillAccountDO> {

    default PageResult<BillAccountDO> selectPage(BillAccountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BillAccountDO>()
                .likeIfPresent(BillAccountDO::getAccountName, reqVO.getAccountName())
                .likeIfPresent(BillAccountDO::getBankName, reqVO.getBankName())
                .eqIfPresent(BillAccountDO::getAccountNo, reqVO.getAccountNo())
                .eqIfPresent(BillAccountDO::getBankBranch, reqVO.getBankBranch())
                .orderByDesc(BillAccountDO::getId));
    }

}